<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>隔行换色</title>
    <script src="../js/jquery-3.3.1.min.js"></script>

    <script>
        $(function () {
            //获取数据行的奇数行的tr，设置背景色为pink
            $("tr:gt(1):odd").css("backgroundColor","pink");

            //获取数据行的偶数行的tr,设置背景色为yellow
            $("tr:gt(1):even").css("backgroundColor","yellow");
        });
    </script>
</head>
<body>
    <table id="tab1" border="1" width="800" align="center">
        <tr>
            <td solspan="5">
                <input type="button" value="删除">
            </td>
        </tr>

        <tr style="background-color: #da921a;">
            <th><input type="checkbox"></th>
            <th>分类ID</th>
            <th>分类名称</th>
            <th>分类描述</th>
            <th>操作</th>
        </tr>

        <tr>
            <td><input type="checkbox"></td>
            <td>0</td>
            <td>手机数码</td>
            <td>手机数码类商品</td>
            <td>
                <a href="">修改</a>
                <a href="">删除</a>
            </td>
        </tr>

        <tr>
            <td><input type="checkbox"></td>
            <td>1</td>
            <td>电脑办公</td>
            <td>电脑办公类商品</td>
            <td>
                <a href="">修改</a>
                <a href="">删除</a>
            </td>
        </tr>

        <tr>
            <td><input type="checkbox"></td>
            <td>2</td>
            <td>鞋靴箱包</td>
            <td>鞋靴箱包类商品</td>
            <td>
                <a href="">修改</a>
                <a href="">删除</a>
            </td>
        </tr>

        <tr>
            <td><input type="checkbox"></td>
            <td>3</td>
            <td>家居饰品</td>
            <td>家居饰品类商品</td>
            <td>
                <a href="">修改</a>
                <a href="">删除</a>
            </td>
        </tr>

    </table>
</body>
</html>